package deanandjames.sprite;

import java.awt.*;
import java.awt.image.BufferedImage;

public class Brick {
	private int height;
	private BufferedImage image;
	private final int imageID;
	private final int mapX;
	private final int mapY;
	private int yLocation;

	public Brick(int id, int x, int y) {
		mapX = x;
		mapY = y;
		imageID = id;
	}

	public void display(Graphics g, int xScr) {
		g.drawImage(image, xScr, yLocation, null);
	}

	public int getImageID() {
		return imageID;
	}

	public int getMapX() {
		return mapX;
	}

	public int getMapY() {
		return mapY;
	}

	public int getYLocation() {
		return yLocation;
	}

	public void setImage(BufferedImage image) {
		this.image = image;
		height = image.getHeight();
	}

	public void setYLocation(int panelHeight, int maxYBricks) {
		yLocation = panelHeight - (maxYBricks - mapY) * height;
	}
}
